<!-- TODO update without Prettier formatting (whitespace is significant!) -->
<div class="file">
    <div class="file-header">
        <div class="file-actions">
            <div class="BtnGroup">
                <a id="raw-url" class="btn btn-sm BtnGroup-item" href="/beyang/mux/raw/master/bench_test.go">Raw</a>
                <a
                    class="btn btn-sm js-update-url-with-hash BtnGroup-item"
                    data-hotkey="b"
                    href="/beyang/mux/blame/master/bench_test.go"
                    >Blame</a
                >
                <a rel="nofollow" class="btn btn-sm BtnGroup-item" href="/beyang/mux/commits/master/bench_test.go"
                    >History</a
                >
            </div>

            <a
                class="btn-octicon tooltipped tooltipped-nw"
                href="https://desktop.github.com"
                aria-label="Open this file in GitHub Desktop"
                data-ga-click="Repository, open with desktop, type:mac"
            >
                <svg
                    class="octicon octicon-device-desktop"
                    viewBox="0 0 16 16"
                    version="1.1"
                    width="16"
                    height="16"
                    aria-hidden="true"
                >
                    <path
                        fill-rule="evenodd"
                        d="M15 2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 9H1V3h14v8z"
                    ></path>
                </svg>
            </a>

            <!-- '"` --><!-- </textarea></xmp> -->
            <form
                class="inline-form js-update-url-with-hash"
                action="/beyang/mux/edit/master/bench_test.go"
                accept-charset="UTF-8"
                method="post"
            >
                <input name="utf8" type="hidden" value="✓" /><input
                    type="hidden"
                    name="authenticity_token"
                    value="zhdlJEcKVLK4lerq+K4EdLAD6ez54Kh7jdG9vnpxh1JkvGSadjQ28zJwNCVjjS5oB12efT6x8pqTAh4+cR/wXQ=="
                />
                <button
                    class="btn-octicon tooltipped tooltipped-nw"
                    type="submit"
                    aria-label="Edit this file"
                    data-hotkey="e"
                    data-disable-with=""
                >
                    <svg
                        class="octicon octicon-pencil"
                        viewBox="0 0 14 16"
                        version="1.1"
                        width="14"
                        height="16"
                        aria-hidden="true"
                    >
                        <path
                            fill-rule="evenodd"
                            d="M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"
                        ></path>
                    </svg>
                </button>
            </form>
            <!-- '"` --><!-- </textarea></xmp> -->
            <form
                class="inline-form"
                action="/beyang/mux/delete/master/bench_test.go"
                accept-charset="UTF-8"
                method="post"
            >
                <input name="utf8" type="hidden" value="✓" /><input
                    type="hidden"
                    name="authenticity_token"
                    value="NafwwuWTrDicmvVSaldfM5aV+CQvZNGqmJiYO0vE7n1J7OGDrQtkYJG/e4FJ4sw1P0WFg+xksnYfkE1mGM4lTw=="
                />
                <button
                    class="btn-octicon btn-octicon-danger tooltipped tooltipped-nw"
                    type="submit"
                    aria-label="Delete this file"
                    data-disable-with=""
                >
                    <svg
                        class="octicon octicon-trashcan"
                        viewBox="0 0 12 16"
                        version="1.1"
                        width="12"
                        height="16"
                        aria-hidden="true"
                    >
                        <path
                            fill-rule="evenodd"
                            d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"
                        ></path>
                    </svg>
                </button>
            </form>
        </div>

        <div class="file-info">
            50 lines (41 sloc)
            <span class="file-info-divider"></span>
            1.37 KB
        </div>
    </div>

    <div itemprop="text" class="blob-wrapper data type-go">
        <table class="highlight tab-size js-file-line-container" data-tab-size="8">
            <tbody>
                <tr>
                    <td id="L1" class="blob-num js-line-number" data-line-number="1"></td>
                    <td id="LC1" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-c"
                            ><span class="pl-c">//</span> Copyright 2012 The Gorilla Authors. All rights reserved.</span
                        >
                    </td>
                </tr>
                <tr>
                    <td id="L2" class="blob-num js-line-number" data-line-number="2"></td>
                    <td id="LC2" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-c"
                            ><span class="pl-c">//</span> Use of this source code is governed by a BSD-style</span
                        >
                    </td>
                </tr>
                <tr>
                    <td id="L3" class="blob-num js-line-number" data-line-number="3"></td>
                    <td id="LC3" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-c"
                            ><span class="pl-c">//</span> license that can be found in the LICENSE file.</span
                        >
                    </td>
                </tr>
                <tr>
                    <td id="L4" class="blob-num js-line-number" data-line-number="4"></td>
                    <td id="LC4" class="blob-code blob-code-inner js-file-line"></td>
                </tr>
                <tr>
                    <td id="L5" class="blob-num js-line-number" data-line-number="5"></td>
                    <td id="LC5" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-k">package</span> mux
                    </td>
                </tr>
                <tr>
                    <td id="L6" class="blob-num js-line-number" data-line-number="6"></td>
                    <td id="LC6" class="blob-code blob-code-inner js-file-line"></td>
                </tr>
                <tr>
                    <td id="L7" class="blob-num js-line-number" data-line-number="7"></td>
                    <td id="LC7" class="blob-code blob-code-inner js-file-line"><span class="pl-k">import</span> (</td>
                </tr>
                <tr>
                    <td id="L8" class="blob-num js-line-number" data-line-number="8"></td>
                    <td id="LC8" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-s"><span class="pl-pds">"</span>net/http<span class="pl-pds">"</span></span>
                    </td>
                </tr>
                <tr>
                    <td id="L9" class="blob-num js-line-number" data-line-number="9"></td>
                    <td id="LC9" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-s"
                            ><span class="pl-pds">"</span>net/http/httptest<span class="pl-pds">"</span></span
                        >
                    </td>
                </tr>
                <tr>
                    <td id="L10" class="blob-num js-line-number" data-line-number="10"></td>
                    <td id="LC10" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-s"><span class="pl-pds">"</span>testing<span class="pl-pds">"</span></span>
                    </td>
                </tr>
                <tr>
                    <td id="L11" class="blob-num js-line-number" data-line-number="11"></td>
                    <td id="LC11" class="blob-code blob-code-inner js-file-line">)</td>
                </tr>
                <tr>
                    <td id="L12" class="blob-num js-line-number" data-line-number="12"></td>
                    <td id="LC12" class="blob-code blob-code-inner js-file-line"></td>
                </tr>
                <tr>
                    <td id="L13" class="blob-num js-line-number" data-line-number="13"></td>
                    <td id="LC13" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-k">func</span> <span class="pl-en">BenchmarkMux</span>(<span class="pl-v"
                            >b</span
                        >
                        *<span class="pl-v">testing</span>.<span class="pl-v">B</span>) {
                    </td>
                </tr>
                <tr>
                    <td id="L14" class="blob-num js-line-number" data-line-number="14"></td>
                    <td id="LC14" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">router</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">new</span>(Router)
                    </td>
                </tr>
                <tr>
                    <td id="L15" class="blob-num js-line-number" data-line-number="15"></td>
                    <td id="LC15" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">handler</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">func</span>(w http.<span class="pl-smi">ResponseWriter</span>, r *http.<span
                            class="pl-smi"
                            >Request</span
                        >) {}
                    </td>
                </tr>
                <tr>
                    <td id="L16" class="blob-num js-line-number" data-line-number="16"></td>
                    <td id="LC16" class="blob-code blob-code-inner js-file-line">
                        router.<span class="pl-c1">HandleFunc</span>(<span class="pl-s"
                            ><span class="pl-pds">"</span>/v1/{v1}<span class="pl-pds">"</span></span
                        >, handler)
                    </td>
                </tr>
                <tr>
                    <td id="L17" class="blob-num js-line-number" data-line-number="17"></td>
                    <td id="LC17" class="blob-code blob-code-inner js-file-line"></td>
                </tr>
                <tr>
                    <td id="L18" class="blob-num js-line-number" data-line-number="18"></td>
                    <td id="LC18" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">request</span>, <span class="pl-smi">_</span>
                        <span class="pl-k">:=</span> http.<span class="pl-c1">NewRequest</span>(<span class="pl-s"
                            ><span class="pl-pds">"</span>GET<span class="pl-pds">"</span></span
                        >,
                        <span class="pl-s"><span class="pl-pds">"</span>/v1/anything<span class="pl-pds">"</span></span
                        >, <span class="pl-c1">nil</span>)
                    </td>
                </tr>
                <tr>
                    <td id="L19" class="blob-num js-line-number" data-line-number="19"></td>
                    <td id="LC19" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-k">for</span> <span class="pl-smi">i</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">0</span>; i &lt; b.<span class="pl-smi">N</span>; i++ {
                    </td>
                </tr>
                <tr>
                    <td id="L20" class="blob-num js-line-number" data-line-number="20"></td>
                    <td id="LC20" class="blob-code blob-code-inner js-file-line">
                        router.<span class="pl-c1">ServeHTTP</span>(<span class="pl-c1">nil</span>, request)
                    </td>
                </tr>
                <tr>
                    <td id="L21" class="blob-num js-line-number" data-line-number="21"></td>
                    <td id="LC21" class="blob-code blob-code-inner js-file-line">}</td>
                </tr>
                <tr>
                    <td id="L22" class="blob-num js-line-number" data-line-number="22"></td>
                    <td id="LC22" class="blob-code blob-code-inner js-file-line">}</td>
                </tr>
                <tr>
                    <td id="L23" class="blob-num js-line-number" data-line-number="23"></td>
                    <td id="LC23" class="blob-code blob-code-inner js-file-line"></td>
                </tr>
                <tr>
                    <td id="L24" class="blob-num js-line-number" data-line-number="24"></td>
                    <td id="LC24" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-k">func</span> <span class="pl-en">BenchmarkMuxAlternativeInRegexp</span>(<span
                            class="pl-v"
                            >b</span
                        >
                        *<span class="pl-v">testing</span>.<span class="pl-v">B</span>) {
                    </td>
                </tr>
                <tr>
                    <td id="L25" class="blob-num js-line-number" data-line-number="25"></td>
                    <td id="LC25" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">router</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">new</span>(Router)
                    </td>
                </tr>
                <tr>
                    <td id="L26" class="blob-num js-line-number" data-line-number="26"></td>
                    <td id="LC26" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">handler</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">func</span>(w http.<span class="pl-smi">ResponseWriter</span>, r *http.<span
                            class="pl-smi"
                            >Request</span
                        >) {}
                    </td>
                </tr>
                <tr>
                    <td id="L27" class="blob-num js-line-number" data-line-number="27"></td>
                    <td id="LC27" class="blob-code blob-code-inner js-file-line">
                        router.<span class="pl-c1">HandleFunc</span>(<span class="pl-s"
                            ><span class="pl-pds">"</span>/v1/{v1:(?:a|b)}<span class="pl-pds">"</span></span
                        >, handler)
                    </td>
                </tr>
                <tr>
                    <td id="L28" class="blob-num js-line-number" data-line-number="28"></td>
                    <td id="LC28" class="blob-code blob-code-inner js-file-line"></td>
                </tr>
                <tr>
                    <td id="L29" class="blob-num js-line-number" data-line-number="29"></td>
                    <td id="LC29" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">requestA</span>, <span class="pl-smi">_</span>
                        <span class="pl-k">:=</span> http.<span class="pl-c1">NewRequest</span>(<span class="pl-s"
                            ><span class="pl-pds">"</span>GET<span class="pl-pds">"</span></span
                        >, <span class="pl-s"><span class="pl-pds">"</span>/v1/a<span class="pl-pds">"</span></span
                        >, <span class="pl-c1">nil</span>)
                    </td>
                </tr>
                <tr>
                    <td id="L30" class="blob-num js-line-number" data-line-number="30"></td>
                    <td id="LC30" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">requestB</span>, <span class="pl-smi">_</span>
                        <span class="pl-k">:=</span> http.<span class="pl-c1">NewRequest</span>(<span class="pl-s"
                            ><span class="pl-pds">"</span>GET<span class="pl-pds">"</span></span
                        >, <span class="pl-s"><span class="pl-pds">"</span>/v1/b<span class="pl-pds">"</span></span
                        >, <span class="pl-c1">nil</span>)
                    </td>
                </tr>
                <tr>
                    <td id="L31" class="blob-num js-line-number" data-line-number="31"></td>
                    <td id="LC31" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-k">for</span> <span class="pl-smi">i</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">0</span>; i &lt; b.<span class="pl-smi">N</span>; i++ {
                    </td>
                </tr>
                <tr>
                    <td id="L32" class="blob-num js-line-number" data-line-number="32"></td>
                    <td id="LC32" class="blob-code blob-code-inner js-file-line">
                        router.<span class="pl-c1">ServeHTTP</span>(<span class="pl-c1">nil</span>, requestA)
                    </td>
                </tr>
                <tr>
                    <td id="L33" class="blob-num js-line-number" data-line-number="33"></td>
                    <td id="LC33" class="blob-code blob-code-inner js-file-line">
                        router.<span class="pl-c1">ServeHTTP</span>(<span class="pl-c1">nil</span>, requestB)
                    </td>
                </tr>
                <tr>
                    <td id="L34" class="blob-num js-line-number" data-line-number="34"></td>
                    <td id="LC34" class="blob-code blob-code-inner js-file-line">}</td>
                </tr>
                <tr>
                    <td id="L35" class="blob-num js-line-number" data-line-number="35"></td>
                    <td id="LC35" class="blob-code blob-code-inner js-file-line">}</td>
                </tr>
                <tr>
                    <td id="L36" class="blob-num js-line-number" data-line-number="36"></td>
                    <td id="LC36" class="blob-code blob-code-inner js-file-line"></td>
                </tr>
                <tr>
                    <td id="L37" class="blob-num js-line-number" data-line-number="37"></td>
                    <td id="LC37" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-k">func</span> <span class="pl-en">BenchmarkManyPathVariables</span>(<span
                            class="pl-v"
                            >b</span
                        >
                        *<span class="pl-v">testing</span>.<span class="pl-v">B</span>) {
                    </td>
                </tr>
                <tr>
                    <td id="L38" class="blob-num js-line-number" data-line-number="38"></td>
                    <td id="LC38" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">router</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">new</span>(Router)
                    </td>
                </tr>
                <tr>
                    <td id="L39" class="blob-num js-line-number" data-line-number="39"></td>
                    <td id="LC39" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">handler</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">func</span>(w http.<span class="pl-smi">ResponseWriter</span>, r *http.<span
                            class="pl-smi"
                            >Request</span
                        >) {}
                    </td>
                </tr>
                <tr>
                    <td id="L40" class="blob-num js-line-number" data-line-number="40"></td>
                    <td id="LC40" class="blob-code blob-code-inner js-file-line">
                        router.<span class="pl-c1">HandleFunc</span>(<span class="pl-s"
                            ><span class="pl-pds">"</span>/v1/{v1}/{v2}/{v3}/{v4}/{v5}<span class="pl-pds"
                                >"</span
                            ></span
                        >, handler)
                    </td>
                </tr>
                <tr>
                    <td id="L41" class="blob-num js-line-number" data-line-number="41"></td>
                    <td id="LC41" class="blob-code blob-code-inner js-file-line"></td>
                </tr>
                <tr>
                    <td id="L42" class="blob-num js-line-number" data-line-number="42"></td>
                    <td id="LC42" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">matchingRequest</span>, <span class="pl-smi">_</span>
                        <span class="pl-k">:=</span> http.<span class="pl-c1">NewRequest</span>(<span class="pl-s"
                            ><span class="pl-pds">"</span>GET<span class="pl-pds">"</span></span
                        >,
                        <span class="pl-s"><span class="pl-pds">"</span>/v1/1/2/3/4/5<span class="pl-pds">"</span></span
                        >, <span class="pl-c1">nil</span>)
                    </td>
                </tr>
                <tr>
                    <td id="L43" class="blob-num js-line-number" data-line-number="43"></td>
                    <td id="LC43" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">notMatchingRequest</span>, <span class="pl-smi">_</span>
                        <span class="pl-k">:=</span> http.<span class="pl-c1">NewRequest</span>(<span class="pl-s"
                            ><span class="pl-pds">"</span>GET<span class="pl-pds">"</span></span
                        >,
                        <span class="pl-s"><span class="pl-pds">"</span>/v1/1/2/3/4<span class="pl-pds">"</span></span
                        >, <span class="pl-c1">nil</span>)
                    </td>
                </tr>
                <tr>
                    <td id="L44" class="blob-num js-line-number" data-line-number="44"></td>
                    <td id="LC44" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-smi">recorder</span> <span class="pl-k">:=</span> httptest.<span class="pl-c1"
                            >NewRecorder</span
                        >()
                    </td>
                </tr>
                <tr>
                    <td id="L45" class="blob-num js-line-number" data-line-number="45"></td>
                    <td id="LC45" class="blob-code blob-code-inner js-file-line">
                        <span class="pl-k">for</span> <span class="pl-smi">i</span> <span class="pl-k">:=</span>
                        <span class="pl-c1">0</span>; i &lt; b.<span class="pl-smi">N</span>; i++ {
                    </td>
                </tr>
                <tr>
                    <td id="L46" class="blob-num js-line-number" data-line-number="46"></td>
                    <td id="LC46" class="blob-code blob-code-inner js-file-line">
                        router.<span class="pl-c1">ServeHTTP</span>(<span class="pl-c1">nil</span>, matchingRequest)
                    </td>
                </tr>
                <tr>
                    <td id="L47" class="blob-num js-line-number" data-line-number="47"></td>
                    <td id="LC47" class="blob-code blob-code-inner js-file-line">
                        router.<span class="pl-c1">ServeHTTP</span>(recorder, notMatchingRequest)
                    </td>
                </tr>
                <tr>
                    <td id="L48" class="blob-num js-line-number" data-line-number="48"></td>
                    <td id="LC48" class="blob-code blob-code-inner js-file-line">}</td>
                </tr>
                <tr>
                    <td id="L49" class="blob-num js-line-number" data-line-number="49"></td>
                    <td id="LC49" class="blob-code blob-code-inner js-file-line">}</td>
                </tr>
            </tbody>
        </table>

        <div
            class="BlobToolbar position-absolute js-file-line-actions dropdown js-menu-container js-select-menu d-none"
            aria-hidden="true"
        >
            <button
                class="btn-octicon ml-0 px-2 p-0 bg-white border border-gray-dark rounded-1 dropdown-toggle js-menu-target"
                type="button"
                aria-expanded="false"
                aria-haspopup="true"
                aria-label="Inline file action toolbar"
                aria-controls="inline-file-actions"
            >
                <svg
                    class="octicon octicon-kebab-horizontal"
                    viewBox="0 0 13 16"
                    version="1.1"
                    width="13"
                    height="16"
                    aria-hidden="true"
                >
                    <path
                        fill-rule="evenodd"
                        d="M1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm5 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM13 7.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"
                    ></path>
                </svg>
            </button>
            <div class="dropdown-menu-content js-menu-content" id="inline-file-actions">
                <ul class="BlobToolbar-dropdown dropdown-menu dropdown-menu-se mt-2">
                    <li>
                        <clipboard-copy
                            class="dropdown-item"
                            id="js-copy-lines"
                            style="cursor:pointer;"
                            data-original-text="Copy lines"
                            tabindex="0"
                            role="button"
                            >Copy lines</clipboard-copy
                        >
                    </li>
                    <li>
                        <clipboard-copy
                            class="dropdown-item"
                            id="js-copy-permalink"
                            style="cursor:pointer;"
                            data-original-text="Copy permalink"
                            tabindex="0"
                            role="button"
                            >Copy permalink</clipboard-copy
                        >
                    </li>
                    <li>
                        <a
                            class="dropdown-item js-update-url-with-hash"
                            id="js-view-git-blame"
                            href="/beyang/mux/blame/058953caa945faa213f42789c5921a53f9135a5e/bench_test.go"
                            >View git blame</a
                        >
                    </li>
                    <li><a class="dropdown-item" id="js-new-issue" href="/beyang/mux/issues/new">Open new issue</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
